<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

	<div id="editForProjectFinishApplyRatify" class="easyui-window" title="复核项目完结申请" data-options="modal:true,closed:true,iconCls:'icon-search'" style="width:720px; height:500px;padding:5px;">
		<div class="easyui-layout" data-options="fit:true">
			<div data-options="region:'center'" style="padding:10px;">
				<form id="editForProjectFinishApplyRatifyForm" method="post" action="ratifyProjectFinishApply" style = "width:100%; height: 100%">
					<input type="hidden" id="projectFinishApplyRatifyId" name = "id"/>
					<input type="hidden" id="projectFinishApplyRatifyStatus" name = "status" value="5000"/>
					<input type="hidden" id="projectFinishApplyRatifyProjectId" name = "project.id"/>
					<input type="hidden" id="projectFinishApplyRatifyProjectStatus" name = "project.status" value="9000"/>
					
					<table width="100%" height="100%">
						<tr>
							<td width="100px;" align="right">项目名称：</td>
							<td>
								<input class="easyui-textbox" readonly="readonly" id="projectFinishApplyRatifyProjectName"  style="width: 200px;"/>
							</td>
							<td width="100px;" align="right">申请人：</td>
							<td>
								<input class="easyui-textbox" readonly="readonly" id="projectFinishApplyRatifyApplyPersonName" style="width: 200px;" />							
							</td>
						</tr>
						<tr>
							<td align="right">申请时间：</td>
							<td>
								<input class="easyui-datetimebox" readonly="readonly" name="applyTime" id="projectFinishApplyRatifyApplyTime" style="width: 200px;"/>
							</td>
						</tr>
						<tr>
							<td align="right">申请说明：</td>
							<td colspan="3">
								<input class="easyui-textbox"  readonly="readonly" data-options="multiline:true" style="width: 550px; height: 80px;" name="applyReason" id="projectFinishApplyRatifyApplyReason">
							</td>
						</tr>
						<tr>
							<td align="right">审核人：</td>
							<td>
								<input class="easyui-textbox" readonly="readonly" id="projectFinishApplyRatifyCheckPersonName" style="width: 200px;" />							
							</td>
							<td align="right">审核时间：</td>
							<td>
								<input class="easyui-datetimebox" readonly="readonly" name="applyTime" id="projectFinishApplyRatifyCheckTime" style="width: 200px;"/>
							</td>
						</tr>
						<tr>
							<td align="right">审核意见：</td>
							<td colspan="3">
								<input class="easyui-textbox"  readonly="readonly" data-options="multiline:true" style="width: 550px; height: 80px;" name="checkDescription" id="projectFinishApplyRatifyCheckDescription" />
							</td>
						</tr>
						<tr>
							<td align="right">计划消耗总工时：</td>
							<td>
								<input class="easyui-textbox" readonly="readonly" id="projectFinishApplyRatifyPlanConsumeWorkTime" style="width: 200px;" />
							</td>
							<td align="right">实际消耗总工时：</td>
							<td>
								<input class="easyui-textbox" readonly="readonly" id="projectFinishApplyRatifyActualConsumeWorktime" style="width: 200px;" />							
							</td>
						</tr>
						<tr>
							<td align="right">复核意见：</td>
							<td colspan="3">
								<input class="easyui-textbox" data-options="multiline:true" style="width: 550px; height: 120px;" name="ratifyDescription" id="projectFinishApplyRatifyRatifyDescription" />
							</td>
						</tr>
					</table>
				</form>
			</div>
			<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 0;">
				<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="$('#editForProjectFinishApplyRatifyForm').submit()" style="width:80px">通过</a>
				<a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#projectFinishApplyRatifyStatus').val('4001');$('#projectFinishApplyRatifyProjectStatus').val('0055');$('#editForProjectFinishApplyRatifyForm').submit()" style="width:80px">驳回</a>
				<a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="javascript:$('#editForProjectFinishApplyRatify').window('close')" style="width:80px">关 闭</a>
			</div>
		</div>
	</div>
	
	<script type="text/javascript">
	function editForProjectFinishApplyRatify(id){
		$.ajax({ url: "getProjectFinishApply?id="+id, success: function(data){
			clearForm("editForProjectFinishApplyRatifyForm", "editForProjectFinishApplyRatify");
			
			var val = $.parseJSON(data);
			$("#projectFinishApplyRatifyId").val(id);
			$("#projectFinishApplyRatifyStatus").val("5000");
			$("#projectFinishApplyRatifyProjectId").val(val.projectId);
			$("#projectFinishApplyRatifyProjectStatus").val("9000");
			$("#projectFinishApplyRatifyProjectName").textbox("setValue",val.projectName);
			$("#projectFinishApplyRatifyApplyPersonName").textbox("setValue",val.applyPersonName);
			$("#projectFinishApplyRatifyApplyTime").textbox("setValue",val.applyTime);
			$("#projectFinishApplyRatifyApplyReason").textbox("setValue",val.applyReason);
			$("#projectFinishApplyRatifyCheckDescription").textbox("setValue",val.checkDescription);
			$("#projectFinishApplyRatifyCheckPersonName").textbox("setValue",val.checkPersonName);
			$("#projectFinishApplyRatifyCheckTime").textbox("setValue",val.checkTime);
			$("#projectFinishApplyRatifyPlanConsumeWorkTime").textbox("setValue", val.planConsumeWorkTime);
			$("#projectFinishApplyRatifyActualConsumeWorktime").textbox("setValue", val.actualConsumeWorktime);
		}});
	}
	
	$("#editForProjectFinishApplyRatifyForm").form({
		onSubmit: function(){
			var isValid = $(this).form('validate');
			return isValid;	// 返回false将停止form提交 
	    },
		success:function(data){
			var val = $.parseJSON(data);
			if(val.success){
				$('#dg').datagrid('reload');
				bottomRight('提示', '修改成功！');
				$('#editForProjectFinishApplyRatify').window('close');
			}else{
				$.messager.alert("提示", val.msg, "error");
			}
		}
	});
	</script>